import * as TYPES from './actionTypes';
import {AllOrderUrl} from '../../Component/common/url';

// login
export function OrderAll(token){
	return (dispatch) => {
		let order_all = fetch(AllOrderUrl,{
				method: "POST",
				headers: {
					"Content-Type": "application/json",
					"Authorization": "Bearer "+token
				},
				body:JSON.stringify({state:["finish","canceling","going"]})
			})
			.then(response=>response.json())
			.then((data)=>{
				dispatch({'type': TYPES.ORDER_ALL, order: data});
			}).catch((e)=>{
				console.log(e.message);
				//dispatch({'type': TYPES.SIGN_ERRER, error: e});
			});
	}
}



